{% extends 'old-bootstrap-modal-layout.html.twig' %}

{% import "macro.html.twig" as web_macro %}

{% block title %}
    {{ 'admin.crontab_job.run_log_title'|trans }}
{% endblock %}

{% block body %}

    {% if jobFireds %}
        <table id="job-fires-table" class="table table-striped table-hover">
            <thead>
            <tr>
                <th>{{'admin.crontab_job.execution_time'|trans}}</th>
                <th>{{'admin.crontab_job.status'|trans}}</th>
                <th>{{'admin.crontab_job.operation'|trans}}</th>
            </tr>
            </thead>
            <tbody>
            {% for jobFired in jobFireds %}
                <tr>
                    <td>{{ jobFired.fired_time|date('Y-m-d H:i:s') }}</td>
                    <td>{{ jobFired.status }}</td>
                    <td>
                        <a href="javascript:;" data-url="{{ path('admin_job_fired_logs', {id : jobFired.job_id, jobFiredId: jobFired.id}) }}" class="btn btn-default btn-sm job-fire-logs">
                            {{'admin.crontab_job.log_show_btn'|trans}}
                        </a>
                    </td>
                </tr>
            {% endfor %}
            </tbody>

        </table>
    {% else %}
        <div class="empty">{{'admin.crontab_job.empty_hint'|trans}}</div>
    {% endif %}

    {{ web_macro.ajax_paginator(paginator) }}
{% endblock %}

{% block footer %}
    <button type="button" class="btn btn-link" data-dismiss="modal" >{{'form.btn.close'|trans}}</button>
    <script>app.load('topxiaadminbundle/controller/jobs/job-fireds-modal');</script>
{% endblock %}